package com.ck.demo;

import java.text.DecimalFormat;
import java.util.Random;

public class CommonDemo {

    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            if(i == 10){
                System.out.println("break:"+i);
                break;
            }

            if(i == 2){
                System.out.println("continue:"+i);
                continue;
            }

            if(i == 3){
                System.out.println("return:"+i);
                return;
            }

            System.out.println(i);
        }

    }
    private static void decimalDemo(){
        DecimalFormat df=new DecimalFormat("0000000");
        String orderNo="TAW"+df.format(new Random().nextInt(1000000));
        System.out.println(orderNo);

        long c =299792458;
        System.out.println(new DecimalFormat("光速大小为每秒,###米").format(c));
    }

    private static void subDemo(){
        String code = "100009002002";
        String orgcode = "100009002";

        int len = orgcode.length();
        System.out.println(len);
        System.out.println(code.substring(0,len));
        System.out.println(orgcode.equals(code.substring(0,len)));
    }
}
